<h3>项目角色</h3>

<%= render :file => 'application/sort-js' %>
<table class='list-table'>
  <tr>
    <th>名称</th>
    <th>描述</th>
    <th>排序</th>
    <th></th>
  </tr>

<% @roles.each do |role| %>
  <tr id='r_<%= role.id %>'>
    <td><%= role.name %></td>
    <td><%= role.description %></td>
    <td>
      <%= link_to_function '↑上移', "move_up(#{role.id})" %>
      <%= link_to_function '⤒至顶', "move_top(#{role.id})" %>
      <%= link_to_function '↓下移', "move_down(#{role.id})" %>
      <%= link_to_function '⤓至底',  "move_bottom(#{role.id})" %>
    </td>
    <td>
      <%= link_to '修改', edit_resource_path(role) %>
      <%= link_to '删除', role, confirm: '确定要删除吗?', method: :delete %>
    </td>
  </tr>
<% end %>
</table>

<br />

<%= link_to '新增', new_resource_path %>
